package common.common.dao.impl;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;

import common.common.dao.IUserTypeDao;
import common.common.entity.UserType;

@Repository("userTypeDao")
@Scope("prototype")
public class UserTypeDaoImpl  extends GenericDaoHibernate<UserType, Integer> implements IUserTypeDao {

	@Resource
	UserType userType;
	
	public UserType findById(int userid) {
		userType=findById(userid);
		if(userType!=null){
		return userType;
		}
		return null;
	}

	public UserType findByName(String userTypeName) {
		userType=this.findByName(userTypeName);
		if(userType!=null){
			return userType;
			}
			return null;
	}

	public List<UserType> findAllUserType() {
		List<UserType>  typies=new ArrayList<UserType>();
		typies=this.findAll();
		if(typies.size()>0&& userType!=null){
			return typies;
			}
			return null;
	}



	
	
}

